<%-- 
    Document   : c_choose
    Created on : 2012-12-10, 21:47:26
    Author     : Administrator
--%>

<%@page contentType="text/html"  import="com.hsp.domain.*"  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
    </head>
    <body>
        <%
            //放入一个老鼠对象 
            Rat rat = new Rat();
            rat.setName("小宝");
            rat.setAge(1);
            request.setAttribute("rat1", rat);
        %>

        <c:choose>
            <c:when test="${rat1.age <2}">老鼠很小，不能吃</c:when>
            <c:when test="${rat1.age >2 and rat1.age<20}">老鼠很好吃</c:when>
            <c:otherwise>老鼠很老，不好吃了</c:otherwise>
        </c:choose>
    </body>
</html>
